<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>MQuant</title>

		<style type="text/css">
		</style>

		<script type="text/javascript" src="./stock-js/jquery/js/jquery-3.2.1.min.js"></script>
		<script src="./stock-js/code/highstock.js"></script>
		<script src="./stock-js/code/modules/data.js"></script>
		<script src="./stock-js/code/modules/exporting.js"></script>
		<script src="./stock-js/index.js"></script>
	</head>
	<body>

<div id="container1" style="height: 500px; width: 350px"></div>
<!-- <div id="container2" style="height: 100px; max-width: 100px"></div> -->
</body>

	<script type="text/javascript">

		// getStock('000001.SZ',function(obj){
		// 	console.log('getStock:',obj)
		// });

		// getStock2('000001.SZ',function(obj){
		// 	console.log('getStock2:',obj)
		// });

		// getVersion(function(obj){
		// 	console.log('getVersion:',obj)
		// });

		var code = '000001.SZ'
		jQuery(document).ready(function() {
		// Highcharts.getJSON('https://www.highcharts.com/samples/data/aapl-ohlc.json', function (data) {
		getStock2(code,function(data){
				console.log(data);
				// create the chart
				Highcharts.stockChart('container1', {
					rangeSelector: {
						selected: 1
					},

					title: {
						text: code
					},

					series: [{
						type: 'candlestick',
						name: code,
						data: data,
						dataGrouping: {
							units: [
								[
									'week', // unit name
									[1] // allowed multiples
								], [
									'month',
									[1, 2, 3, 4, 6]
								]
							]
						}
					}]
				});
			});
		});
		</script>
</html>
